<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="my" uri="/myTags"  %>

<div class="structurecls" id ="structure">
	<div id= "xmlDisplay" style="width:1000px;">
	<s:hidden name="targetTagId"/>
	<s:hidden name="delAttrIndex"/>
	<s:hidden name="insertType"/>
	<s:hidden name="sort"/>
	<my:xmlDisplay name="${xmlDisObj}" sort="${sort}" fieldErrors="${fieldErrors}" />
	</div>
</div>
<div class="attrcls" id = "attr" >

	<s:iterator value="xmlObjList" status="stat">
		<div id="attr<s:property value="tagId"/>" class="attrclass">

			<s:set name="index" value="index"/>
			<table border="1" cellspacing="0" cellpadding="5" width="250px">
			<tr>
				<th class="lv" width="30%">
					Attribute名
				</th>
				<th class="lv" width="60%">
					内容
				</th>
				<th class="lv" width="10%">
					処理
				</th>
			</tr>
			<s:iterator value="attrList" status="attrStat">
				<tr>
					<td width="30%">
						<s:textfield cssClass="attrinputcls" name="xmlObjList[%{#index}].attrList[%{#attrStat.index}].name" value="%{name}" size="10" maxlength="200" cssErrorStyle="background-color: #FFE4E1"/>
					</td>
					<td width="60%">
						<s:textfield cssClass="attrinputcls" name="xmlObjList[%{#index}].attrList[%{#attrStat.index}].value" value="%{value}" size="14"  maxlength="200" cssErrorStyle="background-color: #FFE4E1"/>
					</td>
					<td width="10%">
						<input type="button" value="削除" onclick="delAttr('<s:property value="tagId"/>','<s:property value="%{#attrStat.index}"/>')" />
					</td>
				</tr>
			</s:iterator>
			</table>
			<input type="button" value="追加" onclick="addAttr('<s:property value="tagId"/>')" />

			<table style="margin-top: 30px" border="1" cellspacing="0" cellpadding="5" width="250px">
			<tr>
				<th class="lv" >
					テキスト
				</th>
			</tr>
			<tr>
				<td>
					<s:textfield cssClass="attrinputcls" name="xmlObjList[%{#index}].text" value="%{text}" size="20" maxlength="200" cssErrorStyle="background-color: #FFE4E1"/>
				</td>
			</tr>
			</table>
		</div>
	</s:iterator>
</div>
